package com.ztgf.commodity.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.commodity.models.bo.AttributesQueryBO;
import com.ztgf.commodity.models.dto.CommodityFilterAttributesDTO;
import com.ztgf.commodity.models.vo.CommodityFilterAttributesNewVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/*
 * @author: chenyu.wang
 * @date: 2020-09-04
 * @description:筛选属性管理表映射
 */
@Mapper
public interface CommodityFilterAttributesMapper extends BaseMapper<CommodityFilterAttributesDTO> {

    /*
     * @description:查询筛选属性
     * @author: chenyu.wang
     * @date: 2020-09-04
     */
    List<CommodityFilterAttributesNewVO> queryListPage(Page<CommodityFilterAttributesNewVO> page, @Param(value = "item") AttributesQueryBO bo);

    /*
     * @description:查询筛选属性值
     * @author: chenyu.wang
     * @date: 2020-09-04
     */
    List<CommodityFilterAttributesNewVO> queryByParentId(@Param("parentId") Long parentId);

    /*
     * @description:根据Id获取筛选属性
     * @author: chenyu.wang
     * @date: 2020-09-04
     */
    CommodityFilterAttributesNewVO queryById(@Param("id") Long id);

    /*
     * @description:根据分类查询筛选属性
     * @author: chenyu.wang
     * @date: 2020-09-07
     */
    List<CommodityFilterAttributesNewVO> queryByCategoryId(@Param("categoryId") Long categoryId, @Param(value = "filterName") String filterName);

    /**
     * @Description: 查询筛选属性新
     * @Author: chenyu.wang
     * @Params: [page, bo]
     * @Date: 2020.11.04 10:10
     */
    List<CommodityFilterAttributesNewVO> newQueryListPage(Page<CommodityFilterAttributesNewVO> page, @Param(value = "item") AttributesQueryBO bo);

    /**
     * @Description: 查询筛选属性值新
     * @Author: chenyu.wang
     * @Params: [page, bo]
     * @Date: 2020.11.04 10:16
     */
    List<CommodityFilterAttributesNewVO> newQueryByParentId(Page<CommodityFilterAttributesNewVO> page, @Param(value = "item") AttributesQueryBO bo);
}
